package app.purchase.a571xz.com.myandroidframe.bean;

import android.os.Parcel;
import android.os.Parcelable;

import lombok.Data;

/**
 * 用户登录信息
 */
@Data
public class AppUser implements Parcelable {
    //是否是商家
    private Boolean imSeller;
    //头像
    private String imgsrc;
    //用户昵称
    private String userNick;
    //用户唯一登录信息
    private String token;


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.imSeller);
        dest.writeString(this.imgsrc);
        dest.writeString(this.userNick);
        dest.writeString(this.token);
    }

    public AppUser() {
    }

    protected AppUser(Parcel in) {
        this.imSeller = (Boolean) in.readValue(Boolean.class.getClassLoader());
        this.imgsrc = in.readString();
        this.userNick = in.readString();
        this.token = in.readString();
    }

    public static final Creator<AppUser> CREATOR = new Creator<AppUser>() {
        @Override
        public AppUser createFromParcel(Parcel source) {
            return new AppUser(source);
        }

        @Override
        public AppUser[] newArray(int size) {
            return new AppUser[size];
        }
    };
}
